package com.servertrack

import grails.test.mixin.TestFor
import spock.lang.Specification

/**
 * See the API for {@link grails.test.mixin.domain.DomainClassUnitTestMixin} for usage instructions
 */
@TestFor(Times)
class TimesSpec extends Specification {

	/*Times times
    def setup() {
		mockForConstraintsTests(Hotel)
		times = new Times(title:"1.05-15.05",price:"1254",dateCreated: new Date("1987/2/10"))	
    }
	

    void testConstraintsTitleBlank() {
		times = new Times(title:"",price:"1254",dateCreated: new Date("1987/2/10"))
		assertFalse times.validate()
		assertEquals 'blank', times.errors['title']

		times = new Times(title:"1.05-15.05",price:"1254",dateCreated: new Date("1987/2/10"))
		assertTrue times.validate()
    }
   
   void testConstraintsTitleSize() {
	   times = new Times(title:"e",price:"1254",dateCreated: new Date("1987/2/10"))
	   assertFalse times.validate()
	   assertEquals 'size', times.errors['title']

	   times = new Times(title:"werfaerferg elrjgoiw45uyiowmvw0[i450=243vtmlerjkglkdsfjmglskjvlserg",price:"1254",dateCreated: new Date("1987/2/10"))
	   assertFalse times.validate()
	   assertEquals 'size', times.errors['title']

	   times = new Times(title:"1.05-15.05",price:"1254",dateCreated: new Date("1987/2/10"))
	   assertTrue times.validate()
   }
   

      void testConstraintsPriceBlank() {
		times = new Times(title:"1.02-9.02",price:"",dateCreated: new Date("1987/2/10"))
		assertFalse times.validate()
		assertEquals 'blank', times.errors['price']

		times = new Times(title:"1.05-15.05",price:"1254",dateCreated: new Date("1987/2/10"))
		assertTrue times.validate()
    }
	  
	  void testConstraintsEmailNullable() {
		  times.dateCreated = ''
		  assertTrue times.validate()
		  assertNull times.errors['dateCreated']
	  }*/
}
